package thread1;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class pool2 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService pool = Executors.newFixedThreadPool(10);

        pool.execute(()->{
            System.out.println(Thread.currentThread().getName());
        });

        Future<String> submit = pool.submit(() -> {
            return "hello";
        });
//        submit.get();
        System.out.println(submit.get());;
    }
}
